<?php
// +----------------------------------------------------------------------
// | 有小象汇 自研正版源码 赋能开发者
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 http://www.uxphp.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 有小象汇并不是自由软件，未经许可不能去掉有小象汇相关版权
// +----------------------------------------------------------------------
// | Author:  有小象汇
// +----------------------------------------------------------------------

namespace app\model\car;


use crmeb\basic\BaseModel;
use crmeb\traits\ModelTrait;

/**
 * Class CarContact
 * @package app\model\shendeng
 */
class CarContact extends BaseModel
{
    use ModelTrait;
    /**
     * 表主键
     * @var string
     */
    protected $pk = 'id';
    /**
     * 表名
     * @var string
     */
    protected $name = 'car_contact';
    /**
     * 删除
     * @param $query
     * @param $value
     */
    public function searchIsDelAttr($query, $value){
        $query->where('is_del',$value);
    }

    /**
     * 关键字
     * @param $query
     * @param $value
     */
    public function searchKeywordAttr($query, $value){
        if($value !== ''){
            $query->where('card_no|name|phone','like',"%$value%");
        }
    }

    public function searchUidAttr($query,$value){
        if($value !== ''){
            $query->where('uid',$value);
        }
    }

}
